package com.zky.gulimall.product;

/**
 * @Description 副总经理类
 * @Author 张开源
 * @Date 2022/11/22 22:28
 * @Version 1.0
 **/
public class ViceGeneralManager extends Leader {

    public ViceGeneralManager(String name) {
        super.setName(name);
    }

    @Override
    public void handleLeave(LeaveInfo leaveInfo) {
        if (leaveInfo.getLeaveDays() < 20) {
            System.out.println("员工: " + leaveInfo.getEmpName() + "请假,天数: " + leaveInfo.getLeaveDays() + ",理由: " + leaveInfo.getReason());
            System.out.println("副总经理: " + this.name + ",审批通过!");
        } else {
            if (this.nextLeader != null) {//如果有后继对象, 让后继对象继续处理
                this.nextLeader.handleLeave(leaveInfo);
            }
        }
    }
}
